package com.ehotting.edsta.circuitDesign.enums;

public enum ChannelTypeInputEnum implements BaseEnum{

    ANALOGUE(0,"analogue","模拟信号"),
    DIGITAL(1,"digital","数字信号"),
    OTHER(2,"other","其他"),;

    private Integer value;

    private String code;
    private String name;

    ChannelTypeInputEnum(Integer value, String code, String name) {
        this.value = value;
        this.code = code;
        this.name = name;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    public static ChannelTypeInputEnum getByValue(Integer value){
        ChannelTypeInputEnum[] array = ChannelTypeInputEnum.values();
        for(ChannelTypeInputEnum channelType :array){
            if(channelType.getValue().equals(value)){
                return channelType;
            }
        }
        return  ChannelTypeInputEnum.OTHER;
    }
}
